package com.yingli.fragment;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;

import com.yingli.fragment.bottomnavigation.BottomNavigationActivity;
import com.yingli.fragment.drawer.DrawerActivity;
import com.yingli.fragment.manager.ManagerActivity;
import com.yingli.fragment.viewpager.ViewPagerActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //跳转到利用管理方式来管理Fragment的界面
        findViewById(R.id.btn_manager).setOnClickListener(v->{
            startActivity(new Intent(this, ManagerActivity.class));
        });

        //跳转到viewPager的Fragment的界面
        findViewById(R.id.btn_viewPager).setOnClickListener(v->{
            startActivity(new Intent(this, ViewPagerActivity.class));
        });
        findViewById(R.id.btn_bottom_navigation).setOnClickListener(v->{
            startActivity(new Intent(this, BottomNavigationActivity.class));
        });

        findViewById(R.id.btn_drawer).setOnClickListener(v->{
            startActivity(new Intent(this, DrawerActivity.class));
        });
    }


}